package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ScheduleMapper;
import com.ruoyi.system.domain.Schedule;
import com.ruoyi.system.service.IScheduleService;

/**
 * 健身计划推荐Service业务层处理
 * 
 * @author 张英旺
 * @date 2024-02-21
 */
@Service
public class ScheduleServiceImpl implements IScheduleService 
{
    @Autowired
    private ScheduleMapper scheduleMapper;

    /**
     * 查询健身计划推荐
     * 
     * @param scheduleId 健身计划推荐主键
     * @return 健身计划推荐
     */
    @Override
    public Schedule selectScheduleByScheduleId(Long scheduleId)
    {
        return scheduleMapper.selectScheduleByScheduleId(scheduleId);
    }

    /**
     * 查询健身计划推荐列表
     * 
     * @param schedule 健身计划推荐
     * @return 健身计划推荐
     */
    @Override
    public List<Schedule> selectScheduleList(Schedule schedule)
    {
        return scheduleMapper.selectScheduleList(schedule);
    }

    /**
     * 新增健身计划推荐
     * 
     * @param schedule 健身计划推荐
     * @return 结果
     */
    @Override
    public int insertSchedule(Schedule schedule)
    {
        schedule.setCreateTime(DateUtils.getNowDate());
        return scheduleMapper.insertSchedule(schedule);
    }

    /**
     * 修改健身计划推荐
     * 
     * @param schedule 健身计划推荐
     * @return 结果
     */
    @Override
    public int updateSchedule(Schedule schedule)
    {
        schedule.setUpdateTime(DateUtils.getNowDate());
        return scheduleMapper.updateSchedule(schedule);
    }

    /**
     * 批量删除健身计划推荐
     * 
     * @param scheduleIds 需要删除的健身计划推荐主键
     * @return 结果
     */
    @Override
    public int deleteScheduleByScheduleIds(Long[] scheduleIds)
    {
        return scheduleMapper.deleteScheduleByScheduleIds(scheduleIds);
    }

    /**
     * 删除健身计划推荐信息
     * 
     * @param scheduleId 健身计划推荐主键
     * @return 结果
     */
    @Override
    public int deleteScheduleByScheduleId(Long scheduleId)
    {
        return scheduleMapper.deleteScheduleByScheduleId(scheduleId);
    }
}
